package com.hgw.Demo08_StatePattern.Exercises23_8_4;

/**
 * Data time:2021/12/20 18:07
 * StudentID:2019112118
 * Author:hgw
 * Description: 正在打开类，充当具体状态类
 */
public class DoorOpening extends DoorState{
    public DoorOpening(Door door) {
        super(door);
    }

    @Override
    public void click() {
        System.out.println("正在关闭");
        door.setState(super.door.CLOSING);
    }

    @Override
    public void timeout() {
        System.out.println("此时无效");
    }

    @Override
    public void complete() {
        System.out.println("已打开");
        door.setState(super.door.OPEN);
    }
}
